//---------------------------------------------------------------------------
#ifndef CPMvCtrH
#define CPMvCtrH

//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include "Cadpad.h"
#include "CGAUGES.h"
#include "PHDS.h"
#include <Buttons.hpp>
#include <ExtCtrls.hpp>
#include <Menus.hpp>
#include "PHGridEd.h"
#include <Grids.hpp>
#include "StDMMCtr.h"
#include "Word_2K_SRVR.h"
#include <OleServer.hpp>
#include "DMMvCtr.h"
#include "StDMMCtr.h"
#include "DMCli.h"
#include "PHEdit.h"
#include "PHLabel.h"
#include "PHSpdBut.h"
#include "PHCheck.h"
#include "PHCombo.h"
#include "PHMemo.h"
#include "Emissao.h"
#include <ComCtrls.hpp>
#include "DMMvCtr.h"
#include <Dialogs.hpp>
#include "PHSPDBUT.h"

//---------------------------------------------------------------------------
class TCPMvCtr1 : public TCadPad1
{
__published:  // IDE-managed Components
  TWordApplication*  W1;
  TWordDocument*  WD1;
  TBitBtn*  BitBtn4;
 TPageControl *PageControl1;
 TTabSheet *TabSheet1;
 TTabSheet *TabSheet2;
 TTabSheet *TabSheet4;
 PHLabel *PHLabel5;
 PHLabel *PHLabel6;
 PHLabel *PHLabel7;
 PHLabel *PHLabel8;
 PHLabel *PHLabel25;
 PHSpeedButton *PHSpeedButton8;
 PHLabel *PHLabel13;
 PHLabel *PHLabel14;
 PHLabel *PHLabel4;
 PHSpeedButton *PHSpeedButton3;
 PHLabel *PHLabel22;
 PHSpeedButton *PHSpeedButton6;
 PHLabel *PHLabel15;
 PHEdit *PHEdit7;
 PHEdit *PHEdit8;
 PHEdit *PHEdit9;
 PHEdit *PHEdit10;
 PHEdit *PHEdit25;
 PHEdit *PHEdit26;
 PHEdit *PHEdit13;
 PHEdit *PHEdit14;
 PHEdit *PHEdit5;
 PHEdit *PHEdit6;
 PHEdit *PHEdit21;
 PHEdit *PHEdit22;
 PHComboBox *PHComboBox6;
 PHCheckBox *PHCheckBox2;
 PHCheckBox *PHCheckBox1;
 PHEdit *PHEdit17;
 PHLabel *PHLabel16;
 PHSpeedButton *PHSpeedButton5;
 PHEdit *PHEdit18;
 PHEdit *PHEdit23;
 PHLabel *PHLabel23;
 PHSpeedButton *PHSpeedButton7;
 PHEdit *PHEdit24;
 PHLabel *PHLabel19;
 PHLabel *PHLabel18;
 PHLabel *PHLabel17;
 PHLabel *PHLabel24;
 PHLabel *PHLabel26;
 PHLabel *PHLabel27;
 PHComboBox *PHComboBox4;
 PHEdit *PHEdit19;
 PHComboBox *PHComboBox3;
 PHComboBox *PHComboBox5;
 PHEdit *PHEdit15;
 PHEdit *PHEdit16;
 PHLabel *PHLabel20;
 PHMemo *PHMemo1;
 PHLabel *PHLabel3;
 PHEdit *PHEdit4;
 PHSpeedButton *PHSpeedButton2;
 PHComboBox *PHComboBox1;
 PHLabel *PHLabel10;
 PHLabel *PHLabel11;
 PHEdit *PHEdit12;
 PHLabel *PHLabel12;
 PHComboBox *PHComboBox2;
 PHSpeedButton *PHSpeedButton4;
 PHDataSource *DSReajustes;
 TBitBtn *BitBtn3;
 PHGridEdit *PHGridEdit2;
 PHLabel *PHLabel1;
 PHEdit *PHEdit1;
 PHLabel *PHLabel2;
 PHEdit *PHEdit2;
 PHSpeedButton *PHSpeedButton1;
 PHEdit *PHEdit3;
 TBitBtn *BitBtn2;
 TTabSheet *TabSheet3;
 PHGridEdit *PHGridEdit1;
 PHDataSource *DSServPer;
 PHLabel *PHLabel9;
 PHEdit *PHEdit11;
 PHLabel *PHLabel21;
 PHEdit *PHEdit20;
 PHDataSource *DSOrgReajustes;
  void __fastcall FormDestroy( TObject* Sender );
  void __fastcall PHDS1BeforePost( TObject* Sender );
  void __fastcall PHDS1AfterOpen( TObject* Sender );
  void __fastcall BitBtn2Click( TObject* Sender );
  void __fastcall PHDS1StateChange( Estados State );
  void __fastcall PHDS1AfterRead( TObject* Sender );
  void __fastcall BitBtn3Click( TObject* Sender );
  void __fastcall W1Quit( TObject* Sender );
  void __fastcall PHDS1AfterInsert( TObject* Sender );
  void __fastcall BitBtn4Click( TObject* Sender );
 void __fastcall DSServPerBeforePost(TObject *Sender);
 void __fastcall PHDS1BeforeDelete(TObject *Sender);
 void __fastcall FormShow(TObject *Sender);
 void __fastcall DSReajustesBeforePost(TObject *Sender);
 void __fastcall DSReajustesBeforeDelete(TObject *Sender);
 void __fastcall DSReajustesAfterOpen(TObject *Sender);
 void __fastcall DSReajustesBeforeInsert(TObject *Sender);
 void __fastcall DSReajustesBeforeEdit(TObject *Sender);
 void __fastcall PHDS1BeforeInsert(TObject *Sender);
 void __fastcall PHDS1AfterCancel(TObject *Sender);
 void __fastcall PHComboBox6Change(TObject *Sender);
 void __fastcall PHDS1AfterPost(TObject *Sender);
 void __fastcall PHDS1BeforeCancel(TObject *Sender);
 void __fastcall FormKeyPress(TObject *Sender, char &Key);
 void __fastcall DSReajustesAfterPost(TObject *Sender);
 void __fastcall DSReajustesAfterCancel(TObject *Sender);
 void __fastcall DSReajustesBeforeCancel(TObject *Sender);

  private: // User declarations
  void __fastcall HabilitaDesabilitaCampos(void);
  void __fastcall BloqueiaCampos(bool Bloqueio);
  PHDataSource*  DSCli;
  struct CLI*  Cli;
  PHDataSource*  DSSoc;
  struct SOCIOS*  Soc;
  PHDataSource*  DSMvCtrEmi;
  struct MVCTR*  MvCtr;
  PHDataSource*  DSEmp;
  PHDataSource*  DSSocEmp;
  TEmissao *Emissao;
  struct REAJUSTE *REJ;
  enum StatusOperacao{StOprInsert,StOprEdit,StOprAutomatic,StOprNULL};
  StatusOperacao Operacao;
  bool PrimeiroFocoControle;
  bool RegistroMestre;
  bool PermiteFocoGravar;
  bool Habilitar;
  bool Inserindo;
  bool UltimoFoco;

  public:  // User declarations
  __fastcall TCPMvCtr1( TComponent* Owner );
  struct MVCTR*  Mvc;
};

//---------------------------------------------------------------------------
extern PACKAGE TCPMvCtr1*  CPMvCtr1;

//---------------------------------------------------------------------------
#endif

